//    Copyright (C) Kherty.  All rights reserved.
using System;
using System.Windows.Data;
using OpenLS.Chart.UI.Internals;

namespace OpenLS.Chart.UI
{
    class NumericValueToTooltipConverter: IMultiValueConverter
    {
        #region IMultiValueConverter Members

        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            var value = (double) values[0];
            var index = (int) values[1];
            return string.Format(UIStringTable.TooltipFormat, value, index+1);
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotSupportedException();
        }

        #endregion
    }
}
